home *** CD-ROM | disk | FTP | other *** search
- extern short __putMark;
-
- void PutChar(char c);
- void PutText(const char* s, int len );
- void __DecToText (unsigned long dec, char* str );
- void PutSpacesTo(int endpos);
-
- void PutSDecTo(signed long i, int endpos)
- {
- Boolean isNeg;
- int start, n = 0;
- char* str = "0000000000";
-
- if ( isNeg = ( i < 0 ) )
- i = -i;
-
- __DecToText (i, str );
-
- while ( str[n] == '0' && n<9 )
- n++;
-
- start = endpos - (10-n);
-
- if ( isNeg ) start--;
-
- if ( start >= __putMark )
- PutSpacesTo( start-1 );
-
- PutChar( '#' );
- if ( isNeg ) PutChar( '-' );
- PutText( &str[n], 10-n );
- }